<template>
  <div class="shops">
    <img :src="goods.shop_img" alt="" />
    <div class="name">{{ goods.shop_name }}</div>
    <div class="subscript">{{ goods.shop_collection }}人关注</div>
    <div class="number">
      <div class="item">
        <span>{{ goods.shop_goods }}</span
        ><b>所有商品</b>
      </div>
      <div class="item">
        <span>{{ goods.shop_new }}</span
        ><b>新品</b>
      </div>
      <div class="item">
        <span>{{ goods.shop_promotion }}</span
        ><b>促销</b>
      </div>
    </div>
    <div class="option">
      <div class="btn" @click="toShopPage(goods.shop_id)">进店看看</div>
      <div class="btn" @click="shopSollection">收藏店铺</div>
    </div>
    <div class="shop-info">
      <div class="item">
        <div class="tit">商家电话</div>
        <span>{{ goods.shop_phone }}</span>
      </div>
      <div class="item">
        <div class="tit">固定电话</div>
        <span>{{ goods.fixed_telephone || "--/--" }}</span>
      </div>
      <!-- <div class="item">
        <div class="tit">服务时间</div>
        <span>09:00-22:00</span>
      </div> -->
    </div>
  </div>
</template>

<script>
import api from "@/api";
export default {
  props: {
    goods: Object,
  },
  name: "Shops",
  methods: {
    shopSollection() {
      api
        .SHOPS_COLLECTION({ shop_id: this.goods.shop_id, status: 1 })
        .then(() => {
          this.$emit("refresh");
        });
    },
  },
};
</script>

<style lang="scss" scoped>
.shops {
  width: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  img {
    width: 80px;
    height: 80px;
  }
  .name {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
    line-height: 20px;
    margin: 12px 0 13px;
  }
  .subscript {
    font-size: 12px;
    font-weight: 400;
    color: #999999;
    line-height: 17px;
  }
  .number {
    display: flex;
    width: 100%;
    margin: 11px 0 16px;
    justify-content: space-evenly;
    .item {
      //   width: 48px;
      font-size: 12px;
      font-weight: 400;
      color: #666666;
      line-height: 17px;
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-left: 29px;
      &:first-child {
        margin-left: 0;
      }
      b {
        font-weight: 400;
      }
      span {
        color: #dc2c1a;
        margin-bottom: 8px;
      }
    }
  }
  .option {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    .btn {
      &:first-child {
        margin-left: 0;
      }
      cursor: pointer;
      margin-left: 20px;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 78px;
      height: 24px;
      background: #ffffff;
      border-radius: 5px;
      border: 1px solid #dc2c1a;
      font-size: 12px;
      font-weight: 400;
      color: #dc2c1a;
      line-height: 17px;
      &.active {
        background: #dc2c1a;
        color: #fff;
      }
    }
  }
  .shop-info {
    font-size: 12px;
    font-weight: 400;
    color: #666666;
    line-height: 17px;
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
    .item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
    }
  }
}
</style>
